package com.object.module.cbb.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.object.configuration.utils.PageUtils;
import com.object.configuration.utils.Query;

import com.object.dao.cbb.CbbNoticeDao;
import com.object.module.cbb.entity.CbbNoticeEntity;
import com.object.module.cbb.service.CbbNoticeService;


@Service("cbbNoticeService")
public class CbbNoticeServiceImpl extends ServiceImpl<CbbNoticeDao, CbbNoticeEntity> implements CbbNoticeService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CbbNoticeEntity> page = this.page(
                new Query<CbbNoticeEntity>().getPage(params),
                new QueryWrapper<CbbNoticeEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<CbbNoticeEntity> listAll() {
        QueryWrapper<CbbNoticeEntity> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("ne_create_time");
        List<CbbNoticeEntity> list = list(wrapper);
        return list;
    }

}